module.exports = function (api) {
    api.cache(true)

    const presets = [
        [
            "@babel/preset-env",
            {
                "useBuiltIns": "usage",
                "corejs": 3
            }
        ],
        '@babel/preset-react',
        '@babel/preset-typescript'
    ]
    const plugins = [
        [
            "module-resolver",
            {
                "alias": {
                    "@shared": "./shared/src",
                    "@admin": "./admin/src"
                }
            }
        ],
        ['@babel/plugin-proposal-decorators', { legacy: true }],
        ['@babel/plugin-proposal-class-properties', { loose: true }]
    ]

    return {
        presets,
        plugins
    }
}